<term><varname>tls-ca-path</varname></term>
<listitem><para>Path to file containing trusted anchors instead of the system CA database.</para></listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><varname>unconfigured-state</varname></term>
+ <listitem><para>If set, pulls from this remote will fail with the configured text. This is intended for OS vendors which have a subscription process to access content.</para></listitem>
+ </varlistentry>
</variablelist>
</refsect1>
}
else
{
+ g_autofree char *unconfigured_state = NULL;
+
pull_data->remote_name = g_strdup (remote_name_or_baseurl);
/* Fetch GPG verification settings from remote if it wasn't already
if (!ostree_repo_remote_get_gpg_verify_summary (self, pull_data->remote_name,
&pull_data->gpg_verify_summary, error))
goto out;
+
+ /* NOTE: If changing this, see the matching implementation in
+ * ostree-sysroot-upgrader.c
+ */
+ if (!ostree_repo_get_remote_option (self, pull_data->remote_name,
+ "unconfigured-state", NULL,
+ &unconfigured_state,
+ error))
+ goto out;
+
+ if (unconfigured_state)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "remote unconfigured-state: %s", unconfigured_state);
+ goto out;
+ }
}
pull_data->phase = OSTREE_PULL_PHASE_FETCHING_REFS;
if ((self->flags & OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED) == 0)
{
- /* If explicit action by the OS creator is requried to upgrade, print their text as an error */
+ /* If explicit action by the OS creator is requried to upgrade, print their text as an error.
+ * NOTE: If changing this, see the matching implementation in ostree-repo-pull.c.
+ */
unconfigured_state = g_key_file_get_string (self->origin, "origin", "unconfigured-state", NULL);
if (unconfigured_state)
{
assert_file_has_content baz/cow '^moo$'
}
-echo "1..13"
+echo "1..14"
# Try both syntaxes
repo_init
assert_not_has_file baz/saucer
echo "ok static delta 2"
+
+cd ${test_tmpdir}
+${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false --set=unconfigured-state="Access to ExampleOS requires ONE BILLION DOLLARS." origin-subscription file://$(pwd)/ostree-srv/gnomerepo
+if ${CMD_PREFIX} ostree --repo=repo pull origin-subscription main 2>err.txt; then
+ assert_not_reached "pull unexpectedly succeeded?"
+fi
+assert_file_has_content err.txt "ONE BILLION DOLLARS"
+
+echo "ok unconfigured"